#ifndef __TINYSRV_SPINLOCK_H__
#define __TINYSRV_SPINLOCK_H__

#include "exception.h"
#include "non_copyable.h"

#include <pthread.h>


namespace tinySrv
{

  DECLARE_TINYSRV_EXCEPTION(Spinlock)
    
  class Spinlock
    : private NonCopyable
  {
  public:
    Spinlock();
    ~Spinlock();
    void Lock();
    void Unlock();
    
  private:
    pthread_spinlock_t SpinHandle;
  };
  
}

#endif  // !__TINYSRV_SPINLOCK_H__
